]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenShield: defer deactivation until all messages are shown
authorRay Strode <rstrode@redhat.com>
Thu, 18 Jul 2013 12:58:58 +0000 (08:58 -0400)
committerRay Strode <rstrode@redhat.com>
Thu, 18 Jul 2013 13:24:01 +0000 (09:24 -0400)
Right now when a user types their password to unlock their session
we end up getting an unlock signal from GDM right away.  We then
proceed to deactivate the screensaver before the user has a chance
to read his messages.

This commit makes sure we clear out the message queue before processing
the deactivation request.

https://bugzilla.gnome.org/show_bug.cgi?id=704347

js/ui/screenShield.js
js/ui/unlockDialog.js

index d7bf4616f8818d720b4e414847a1d7541be42edd..8271aa0a1f46d3599cda69ca82ef63d615ae12ce 100644 (file)
@@ -1121,6 +1121,12 @@ const ScreenShield = new Lang.Class({
     },
 
     deactivate: function(animate) {
+        this._dialog.finish(Lang.bind(this, function() {
+            this._finishDeactivate(animate);
+        }));
+    },
+
+    _finishDeactivate: function(animate) {
         this._hideLockScreen(animate, 0);
 
         if (this._hasLockScreen)
index e2646ea5c470922e4a2ba803cf4364f0c9d1188b..75d11381d49c0b3f848ea80d0188a257e67e119d 100644 (file)
@@ -281,4 +281,18 @@ const UnlockDialog = new Lang.Class({
     addCharacter: function(unichar) {
         this._promptEntry.clutter_text.insert_unichar(unichar);
     },
+
+    finish: function(onComplete) {
+        if (!this._userVerifier.hasPendingMessages) {
+            onComplete();
+            return;
+        }
+
+        let signalId = this._userVerifier.connect('no-more-messages',
+                                                  Lang.bind(this, function() {
+                                                      this._userVerifier.disconnect(signalId);
+                                                      onComplete();
+                                                  }));
+
+    }
 });